@echo off

set errorflag=0

set cFileCabwzi=c:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Tools\cabwiz.exe
set dFileCabwzi=d:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Tools\cabwiz.exe

set fileCabwiz=%cFileCabwzi%
if not exist "%cFileCabwzi%" (
set fileCabwiz=%dFileCabwzi%
if not exist "%dFileCabwzi%" (
ECHO *******************************************************
ECHO ERROR Could not found file:
ECHO %cFileCabwzi%
ECHO or %dFileCabwzi%
ECHO *******************************************************
ECHO Press any key to try again...
PAUSE
set errorflag=1
goto Exit
)
)


:camerademo
set fcInf=mshare.inf
if not exist "%fcInf%" (
ECHO *******************************************************
ECHO ERROR make cab: Could not found file %fcInf%
ECHO *******************************************************
ECHO Press any key to try again...
PAUSE
set errorflag=1
goto qrdecoder
)
echo Building %fileCabwiz% %fcInf%
"%fileCabwiz%" %fcInf% /err camerademo_err.txt /cpu WM_ARM
ECHO mshare install package Done!!!!!!
IF /i "%1" EQU "camerademo" goto Exit

cd SetupNsis
makensis mshare.nsi

cd ..

:Usage
@echo --------------------------------------------------
@echo Usage:         NSIS_buildEx (componet)
@echo Componet:      fw_forti,cmpt_ac,cmpt_av,cmpt_fw,cmpt_ns,cmpt_ssl,cmpt_cm,makepkg
@echo	               all = all the aboves
@echo --------------------------------------------------

call pause
:Exit
